<?php
/**
 *
 *
 */
namespace Yz\modules\Install;
class Controller_Default
    extends \Yz_Controller_Templated
    implements \Yz_Controller_Interface
{


    /**
     *
     */
    public function doGET()
    {
        $modules = array();
        $path = YZ_LIB . 'Yz/modules';
        $moduleDir = dir($path);
        while (false !== ($entry = $moduleDir->read())) {
            if ('.' !== substr($entry,0,1)) {
                include_once($path.'/'.$entry.'/'.'Module.php');
                $class = "Yz\\modules\\{$entry}\\Module";
                if (is_subclass_of($class,'Yz_Module_WebModule_Interface')) {
                    $modules[] = $entry;
                }
            }
        }
        sort($modules);
        $template = $this->selectTemplate();
        $template->modules = $modules;
        $template->h1 = <<<html
Install
html;

        return $this->outputTemplate($template);
    }

}
